]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dbusService: Don't double-wrap remote errors
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 31 Jan 2024 15:16:04 +0000 (16:16 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 31 Jan 2024 18:03:12 +0000 (19:03 +0100)
Returning a GLib.Error from a method invocation will encode the
error when sent over the wire. In case the error itself is already
an encoded remote error, just passing it on will result in double
wrapping.

Avoid that by stripping any remote error information before
returning it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3159>

js/dbusServices/dbusService.js

index 422ef60e24c2ed911475bb5349f3d2cd1082812a..ab7af9291bc3fb7f8a8149b6058752570edb834d 100644 (file)
@@ -75,6 +75,7 @@ export class ServiceImplementation {
             return false;
 
         if (error instanceof GLib.Error) {
+            Gio.DBusError.strip_remote_error(error);
             invocation.return_gerror(error);
         } else {
             let name = error.name;